<!--
 * @company : 版权所属 四川北星惯牌科技有限公司
 * @contact : 刘经理 19326416371
 -->
<template>
	<view class="nearbyStyle-one flex">
		<view class="nearby-list">
			<swiper @change="changeItem" class="swiper" circular previous-margin="122rpx" next-margin="122rpx">
				<swiper-item v-for="(item,index) in nearbyItemList" :key="item.id">
					<view class="list_item">
						<nearbyItemVue :nearbyInfo="item"></nearbyItemVue>
					</view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script setup>
	import {
		computed
	} from 'vue';
	import nearbyItemVue from './nearbyItem.vue';
	const emit = defineEmits(['changePosition']);
	const props = defineProps({
		nearbyList: {
			default: []
		},

	})
	const nearbyItemList = computed(() => props.nearbyList);
	onLoad(async () => {})
	const changeItem = (e) => {
		let index = e.detail.current;
		emit('changePosition', nearbyItemList.value[index])
	}
</script>

<style lang="scss" scoped>
	.nearbyStyle-one {
		width: 100%;
		box-sizing: border-box;
		position: absolute;
		bottom: 0;
		left: 0;
		flex-direction: column;



		.nearby-list {
			padding-bottom: 8rpx;
			height: 320rpx;

			.swiper {
				width: 100%;
				height: 100%;

				.list_item {
					width: 492rpx;
					height: 100%;
				}
			}
		}
	}
</style>